package com.smedi.ismedi.progress.core.infrastructure.constant;


public enum TypeEnum {
    mobileCrane("mobileCrane", "流动式起重机"),
    towerCrane("towerCrane", "塔式起重机"),
    constructionLifts("constructionLifts", "施工升降机"),
    crawlerCraneAbove50T("crawlerCraneAbove50T", "50T以上履带吊"),
    crawlerPileDriver("crawlerPileDriver", "履带式打桩机"),
    slottingMachine("slottingMachine", "成槽机"),
    shieldMachine("shieldMachine", "盾构机"),
    pipeJackingEquipment("pipeJackingEquipment", "顶管设备"),
    floatingCrane("floatingCrane", "浮吊"),
    paver("paver", "摊铺机"),
    roller("roller", "压路机"),
    millingMachine("millingMachine", "铣刨机"),
    excavator("excavator", "挖掘机"),
    loader("loader", "装载机"),
    erectingMachine("erectingMachine", "架桥机"),
    peopleFreightElevator("peopleFreightElevator", "人货梯"),
    other("other", "其他");
    String name;
    String value;

    TypeEnum(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return this.name;
    }
    public String getValue() {
        return this.value;
    }


    //根据name获取value的值
    public static String getValueByName(String name){
        for (TypeEnum s : TypeEnum.values()) {
            if(s.getName().equals(name)){
                return s.getValue();
            }
        }
        return name;
    }


    //根据匹配value的值获取key
    public static String getNameByValue(String value){
        for (TypeEnum s : TypeEnum.values()) {
            if(value.equals(s.getValue())){
                return s.getName();
            }
        }
        return value;
    }
}


